hg clone [[http://code.google.com/p/chromium-compact-language-detector/]]
cd chromium-compact-language-detector
./build.sh
cd ..
git clone [[https://github.com/lstrojny/php-cld.git]]
cd php-cld
phpize && ./configure --with-libcld-dir=/full/path/to/chromium/checkout/build && make && sudo make install